import 'package:flutter/material.dart';
import 'package:library_base/base/base_app_state_page.dart';
import 'package:library_base/global/multi_language.dart';
import 'package:get/get.dart';
import 'package:library_base/utils/theme_util.dart';
import 'package:module_wms/page/incoming_orders/incoming_orders_detail/single_head_entry_page/wms_single_head_entry_page_controller.dart';
import 'package:module_wms/page/incoming_orders/incoming_orders_detail/single_head_entry_page/wms_single_head_entry_page_ui.dart';

class WmsSingleHeadEntryPage extends StatefulWidget {
  const WmsSingleHeadEntryPage({Key? key}) : super(key: key);

  @override
  _WmsSingleHeadEntryPageState createState() => _WmsSingleHeadEntryPageState();
}

class _WmsSingleHeadEntryPageState extends BaseState<WmsSingleHeadEntryPage, WmsSingleHeadEntryController> {
  @override
  WmsSingleHeadEntryController registerController() => Get.put(WmsSingleHeadEntryController());

  @override
  void onCreate() {
    super.onCreate();
    setTitle(MultiLanguage.singleHeadEntry.tr);
    setNavigationBarColor(ThemeUtil.getTheme().colorScheme.secondary);
  }

  // @override
  // Widget getNavBarRightWidget() {
  //   return batchEditWell((){
  //   });
  // }

  @override
  Widget? getMainWidget(BuildContext context) {
    return Column(children: [
      buildHead(),
      Expanded(
        child: Material(
          child: MediaQuery.removePadding(
            context: context,
            removeTop: true,
            removeBottom: true,
            child: ListView(
              children: buildItem(
                baseGetxController!.list,
                baseGetxController!.weightControllers,
                baseGetxController!.weightFocusNodes,
                baseGetxController!.weightChange,
              ),
            ),
          ),
        ),
      ),
      GetBuilder<WmsSingleHeadEntryController>(
        builder: (logic) {
          return buildBottom(baseGetxController!.isCanSave.value,baseGetxController!.totalWeight,save:baseGetxController!.save);
        },
      )
    ]);
  }

}
